/*
神经网络主类头文件
定义完整的神经网络架构和训练流程
支持前向传播、反向传播和权重更新
*/
#ifndef NEURALNETWORK_H
#define NEURALNETWORK_H

#include <vector>
#include <memory>
#include "NeuronLayer.h"
#include "Connection.h"

class NeuralNetwork {
public:
    NeuralNetwork(const std::vector<int>& topology, double learningRate = 0.01, double momentum = 0.9);
    ~NeuralNetwork();

    void feedForward(const std::vector<double>& input);
    void backPropagate(const std::vector<double>& target);
    void calculateGradients();
    void updateWeights();
    void updateBias();
    const std::vector<double> getOutput() const;
    void print() const;

private:
    std::vector<std::shared_ptr<NeuronLayer> > layers;
    std::vector<std::shared_ptr<Connection> > connections;
    double learningRate;
    double momentum;
};

#endif // NEURALNETWORK_H